<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>在Css中正确使用百分比</title>
    <style>

        #outer{
            width: 400px;
            height: auto;
            background: lightblue;
            position: relative;
        }

        #inner{
            width: 100%;
            height: 50%;
            background: lightpink;
            position: absolute;
        }
    </style>
</head>
<body>
<h1>在Css中正确使用百分比</h1>
<hr>

<div id="outer">
    <div id="inner">
       inner div
    </div>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
</div>

</body>
</html>